package com.camel.iamhi.controller;

import com.camel.iamhi.entities.AjaxResult;
import com.camel.iamhi.model.SysUser;
import com.camel.iamhi.service.BaseService;
import com.camel.iamhi.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/users")
public class SysUserController extends BaseController<SysUser> {

    @PostMapping("/resetPasswd")
    public @ResponseBody AjaxResult resetPasswd(@RequestBody SysUser entity) {
        service.resetPasswd(entity);

        return AjaxResult.success();
    }

    @Resource
    private UserService<SysUser> service;

    @Override
    String indexPagePath() {
        return "users/index :: content";
    }

    @Override
    String moduleName() {
        return "用户";
    }

    @Override
    BaseService<SysUser> getService() {
        return service;
    }
}
